//
//  AIVipPremiumView.m
//  Mia
//
//  Created by Vill on 2024/1/5.
//

#import "AIVipPremiumView.h"

@interface AIVipPremiumView ()

@property (nonatomic, strong) UILabel *leftLbl;      // 左边
@property (nonatomic, strong) UILabel *vipDataLbl;   // vip时间

@end

@implementation AIVipPremiumView

- (instancetype)initWithFrame:(CGRect)frame{
    if (self == [super initWithFrame:frame]){
        [self setupUI];
    }
    return self;
}

-(void)setupUI{
    [self addSubview:self.leftLbl];
    [self addSubview:self.vipDataLbl];
    [self.leftLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self);
        make.centerX.mas_equalTo(self).mas_offset(-PTW(45));
    }];
    [self.vipDataLbl mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.leftLbl);
        make.leading.mas_equalTo(self.leftLbl.mas_trailing).mas_offset(PTW(10));
    }];
}

- (UILabel *)leftLbl{
    if(!_leftLbl){
        _leftLbl = [UILabel new];
        _leftLbl.text = @"Premium expiration";
        _leftLbl.textColor = UIColor.whiteColor;
        _leftLbl.font = [UIFont fontWithWeight:MTBold size:PTW(13)];
    }
    return _leftLbl;
}

- (UILabel *)vipDataLbl{
    if(!_vipDataLbl){
        _vipDataLbl = [UILabel new];
        AIUserInfoModel *model = [[AIUserInfoManager shareManager] userInfo];
        _vipDataLbl.text = model.vipExpireTime;
        _vipDataLbl.textColor = UIColor.whiteColor;
        _vipDataLbl.font = [UIFont fontWithWeight:MTBold size:PTW(15)];
    }
    return _vipDataLbl;
}



@end
